<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>

		<script type="text/javascript">
			while(true){
	// 产生2个随机数
			var num1 = Math.floor(Math.random()*10);
			var num2 = Math.floor(Math.random()*10);
			// 询问
			var result = prompt(num1 + "+" + num2 +"= ?" );
			// 判断
			if(result == num1+num2)
			{
				alert("计算正确")
			}
			else
			{
				alert("计算错误")
			}
		var  sel=confirm("是否继续答题？");
		if (!sel) {
			break;
		}
			
}
		</script>
	</body>
</html>
